<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>开始使用 layui</title>

    <!-- 引入 layui.css -->
    <link rel="stylesheet" href="//unpkg.com/layui@2.6.8/dist/css/layui.css">

    <!-- 引入 layui.js -->
    <script src="//unpkg.com/layui@2.6.8/dist/layui.js"></script>


    <style>
        body{
            background-image: url('../img/16pic_767404_b.jpg');
            background-position: center center;
            background-size: cover;
            background-repeat: no-repeat;
            background-attachment: fixed;
        }
        .loginForm{
            width: 350px;
            height: 300px;
            background-color: white;
            padding: 30px 20px;
            margin-top: 50%;
            border-radius: 5px;
            box-shadow: 0 0 5px black;
            box-sizing: border-box;
        }
    </style>
</head>
<body>


<div class="layui-container">
    <div class="layui-row">
        <div class="layui-col-md4 layui-col-md-offset4">
            <div class="loginForm">
                <h2 align="center">xx管理后台</h2>
                <form  class="layui-form">
                    <div class="layui-form-item">
                        <label>用户名:</label>
                        <div class="layui-form-block">
                            <input type="text" name="username" required lay-verify="required"
                                   placeholder="请输入用户名" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label>密码:</label>
                        <div class="layui-form-block">
                            <input type="password" name="password" required lay-verify="required"
                                   placeholder="请输入密码" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-form-block">
                            <button class="layui-btn" lay-submit lay-filter="loginForm">登录</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>

    <script>
        layui.use(['layer', 'form'], function () {
            var layer = layui.layer;
            var form = layui.form;

            form.on('submit(loginForm)', function (data) {
                // submit login data

                   if (data.field.username=="admin"&&data.field.password=="123456"){
                       window.open('http://localhost:8080/echarts/echarts.html')
                   }else {
                       window.open("http://localhost:8080/404/404.html")
                   }



                return false;
            })
        })
    </script>
</div>
</body>
</html>
